.globl f # this allows other files to find the function f

# f takes in two arguments:
# a0 is the value we want to evaluate f at
# a1 is the address of the "output" array (defined above).
# The return value should be stored in a0
f:
    addi t1 x0 6
    sw t1 0(a1)
    addi t1 x0 61
    sw t1 4(a1)
    addi t1 x0 17
    sw t1 8(a1)
    addi t1 x0 -38
    sw t1 12(a1)
    addi t1 x0 19
    sw t1 16(a1)
    addi t1 x0 42
    sw t1 20(a1)
    addi t1 x0 5
    sw t1 24(a1)
    addi t0 a0 3
    slli t2 t0 2
    add t2 a1 t2
    lw a0 0(t2)
    # This is how you return from a function. You'll learn more about this later.
    # This should be the last line in your program.
    jr ra  